package org.explugin.lang;

import com.intellij.lang.Language;
import com.intellij.openapi.fileTypes.LanguageFileType;
import com.intellij.openapi.fileTypes.SingleLazyInstanceSyntaxHighlighterFactory;
import com.intellij.openapi.fileTypes.SyntaxHighlighter;
import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory;
import org.explugin.ExFileType;
import org.explugin.highlighter.ExHighlighter;
import org.jetbrains.annotations.NotNull;

public class ExLanguage extends Language {

    private static final ExLanguage instance = new ExLanguage();

    public static ExLanguage getInstance() {
        return instance;
    }

    private ExLanguage() {
        super("Ex");
        SyntaxHighlighterFactory.LANGUAGE_FACTORY.addExplicitExtension(this, new SingleLazyInstanceSyntaxHighlighterFactory() {

            @NotNull
            @Override
            protected SyntaxHighlighter createHighlighter() {
                return new ExHighlighter();
            }

        });
    }

    @Override
    public boolean isCaseSensitive() {
        return true;
    }

    @Override
    public LanguageFileType getAssociatedFileType() {
        return ExFileType.getInstance();
    }
}
